package org.example.service.impl;

import org.example.dao.EmpDao;
import org.example.service.BService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * ClassName: BServiceImpl
 * Package: org.example.service.impl
 * Description:
 *
 * @Author wanghao
 * @Create 2024-07-09 15:41
 * @Version 1.0
 */
@Service
public class BServiceImpl implements BService {

    @Autowired
    private EmpDao empDao;

    @Transactional(propagation = Propagation.REQUIRES_NEW)
    @Override
    public void methodB() {
        System.out.println(empDao.getEmpByEmpId(1));
    }
}
